package com.itheima.test02;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/*
题目二：请使用字节流复制一个文件，一次读、写一个1K的字节数组。
 */
public class Test02 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("D:\\IdeaProjects\\studentManagerSystem\\homework0917\\src\\com\\itheima\\testMarryMoney\\Test02.java");
        FileOutputStream fos = new FileOutputStream("D:\\IdeaProjects\\studentManagerSystem\\homework0917\\Test02_copy.java");

        byte[] bytes = new byte[1024];
        int b;
        while ((b = fis.read(bytes)) != -1){
            fos.write(bytes);
        }

        fis.close();
        fos.close();
    }
}
